/*
 * Copyright (c) 2014 Hai Bison
 *
 * See the file LICENSE at the root directory of this project for copying
 * permission.
 */

package haibison.simpleprovider.utils;

/**
 * Utilities for IDs.
 * 
 * @author Hai Bison
 *
 */
public class Ids {

    /**
     * This is singleton class.
     */
    private Ids() {
    }// Ids()

    /**
     * The global unique ID for this session.
     */
    private static int mUid = 0;

    /**
     * Generates new global unique ID for this session. This method is thread
     * safe.
     * 
     * @return new global unique ID.
     */
    public static final synchronized int newUid() {
        return mUid++;
    }// newUid()

}
